<?php
	
	drupal_set_title('');
	$url = $config->getVar('url');
	drupal_add_css('bdbdec/view/css/displayList.css');    
	drupal_add_js('bdbdec/view/scripts/displayList.js');    
	
	
	echo '
	<div id="tabs-wrapper" class="clear-block">
		<h2 class="with-tabs">Liste des s&eacute;ries</h2>';
	
	if ($user->isAllowedTo(GRADE_SEARCH_BOOK))
		echo '
		<div class="right">
			<a class="search" ref="#">Recherche rapide</a>
			<div class="searchTabs">
				<form action="'.$url.'/bdbdec.php?action=quickSearch&amp;element=serie" method="post" style="margin:0px;">
					<input type="text" name="searchfield" class="searchfield" />
					<select name="element">
						<option value="book">Album</option>
						<option value="serie" selected="selected">S&eacute;rie</option>
						<option value="publisher">Editeur</option>
						<option value="author">Auteur</option>
					</select>
					<input type="submit" value="Valider"><br />
					<small><a href="'.$url.'/bdbdec.php?action=search">Recherche avanc&eacute;e</a></small>
				</form>
			</div>
		</div>';
		echo '
	</div>
	<div class="abc">
		<center>
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie">';echo (!$fval)?'<b>Tout</b>':'Tout';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=a">';echo ($fval=='a')?'<b>A</b>':'A';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=b">';echo ($fval=='b')?'<b>B</b>':'B';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=c">';echo ($fval=='c')?'<b>C</b>':'C';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=d">';echo ($fval=='d')?'<b>D</b>':'D';echo '</a> |  
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=e">';echo ($fval=='e')?'<b>E</b>':'E';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=f">';echo ($fval=='f')?'<b>F</b>':'F';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=g">';echo ($fval=='g')?'<b>G</b>':'G';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=h">';echo ($fval=='h')?'<b>H</b>':'H';echo '</a> |  
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=i">';echo ($fval=='i')?'<b>I</b>':'I';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=j">';echo ($fval=='j')?'<b>J</b>':'J';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=k">';echo ($fval=='k')?'<b>K</b>':'K';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=l">';echo ($fval=='l')?'<b>L</b>':'L';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=m">';echo ($fval=='m')?'<b>M</b>':'M';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=n">';echo ($fval=='n')?'<b>N</b>':'N';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=o">';echo ($fval=='o')?'<b>O</b>':'O';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=p">';echo ($fval=='p')?'<b>P</b>':'P';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=q">';echo ($fval=='q')?'<b>Q</b>':'Q';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=r">';echo ($fval=='r')?'<b>R</b>':'R';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=s">';echo ($fval=='s')?'<b>S</b>':'S';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=t">';echo ($fval=='t')?'<b>T</b>':'T';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=u">';echo ($fval=='u')?'<b>U</b>':'U';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=v">';echo ($fval=='v')?'<b>V</b>':'V';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=w">';echo ($fval=='w')?'<b>W</b>':'W';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=x">';echo ($fval=='x')?'<b>X</b>':'X';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=y">';echo ($fval=='y')?'<b>Y</b>':'Y';echo '</a> | 
			<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter=letter&amp;fval=z">';echo ($fval=='z')?'<b>Z</b>':'Z';echo '</a> | 
		</center>
	</div>
	<table>
		<thead>
			<tr>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=se_name&amp;sens='.$sens.'">Nom</a>
				</th>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=se_genre&amp;sens='.$sens.'">Genre</a>
				</th>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=se_stateBDBDEC&amp;sens='.$sens.'">&Eacute;tat &agrave; la BDBDEC</a>
				</th>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=se_statePublisher&amp;sens='.$sens.'">&Eacute;tat chez l\'&eacute;diteur</a>
				</th>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=se_type&amp;sens='.$sens.'">Type</a>    
				</th>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=nb_al&amp;sens='.$sens.'">Nb tomes</a>    
				</th>
				<th>
					<a href="'.$url.'/bdbdec.php?action=displayList&amp;element=serie&amp;filter='.$filter.'&amp;fval='.$fval.'&amp;order=se_mean&amp;sens='.$sens.'">Note <sub>/10</sub></a>
				</th>
			</tr>
		</thead>
		<tbody>';
		
		foreach ($elementsList as $serie)
		{
			echo '
			<tr class="highlightable">
				<td>
					<a href="'.$url.'/bdbdec.php?action=viewElement&amp;element=serie&amp;id='.$serie['se_id'].'">'.stripslashes($serie['se_name']).'</a>
				</td>
				<td>
					'.stripslashes($serie['se_genre']).'
				</td>
				<td>
					'.stripslashes($serie['se_stateBDBDEC']).'
				</td>
				<td>
					'.stripslashes($serie['se_statePublisher']).'
				</td>
				<td>
					'.stripslashes($serie['se_type']).'
				</td>
				<td>
					'.stripslashes($serie['nb_al']).'
				</td>
				<td>';
				if (!is_null($serie['se_mean']))
					echo round($serie['se_mean'],2);
				echo '
				</td>
			</tr>';
		}
		echo '
		</tbody>
		<tfoot>
			<tr>
				<td colspan="5">
					<br />
				</td>
			</tr>
			<tr>
				<td colspan="5">
					<center>
							Pages (' . $pagination->nb_pages . ' pages pour ' . $pagination->nb_datas . ' r&eacute;sultats) : ' . $pagination->getFirstLinks()  . $pagination->getLinks() . $pagination->getLastLinks().'
					</center>
				</td>
			</tr>
		</tfoot>
	</table>
	';
	
	
	
	
?>